home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / archiver / gzip107.zip / GZIP.DOC < prev    next >
Text File  |  1993-03-17  |  9KB  |  215 lines

  1.  
  2. GZIP(1)                  USER COMMANDS                    GZIP(1)
  3.  
  4. NAME
  5.      gzip, gunzip, zcat - compress or expand files
  6.  
  7. SYNOPSIS
  8.      gzip [ -cdfhLrtvV19 ] [ name ... ]
  9.      gunzip [ -cfhLrtvV ] [ name ... ]
  10.      zcat [ -hLV ] [ name ... ]
  11.  
  12. DESCRIPTION
  13.      Gzip reduces the size of the named  files  using  Lempel-Ziv
  14.      coding  (LZ77).  Whenever possible, each file is replaced by
  15.      one with the extension .z, while keeping the same  ownership
  16.      modes,  access and modification times.  (The extension is -z
  17.      for VMS, z for MSDOS, OS/2  and  Atari.)  If  no  files  are
  18.      specified,  the standard input is compressed to the standard
  19.      output. If the new file name is too long, gzip truncates  it
  20.      and  keeps  the  original  file name in the compressed file.
  21.      Gzip will only attempt to compress regular files.   In  par-
  22.      ticular, it will ignore symbolic links.
  23.  
  24.      Compressed files can be  restored  to  their  original  form
  25.      using gzip -d or gunzip or zcat.
  26.  
  27.      gunzip takes a  list  of  files  on  its  command  line  and
  28.      replaces  each  file whose name ends with .z or .Z or -z and
  29.      which  begins  with  the  correct  magic  number   with   an
  30.      uncompressed  file  without  the original extension.  gunzip
  31.      also recognizes the special  extensions  .tgz  and  .taz  as
  32.      shorthands for .tar.z or .tar.Z
  33.  
  34.      gunzip can currently decompress files created by gzip,  zip,
  35.      compress  or  pack.  The  detection  of  the input format is
  36.      automatic.  When using the first two formats, gunzip  checks
  37.      a  32  bit  CRC.  For  pack,  gunzip checks the uncompressed
  38.      length. The compress format was not designed to  allow  con-
  39.      sistency  checks. However gunzip is sometimes able to detect
  40.      a bad .Z file. If you get an error when uncompressing  a  .Z
  41.      file,  do  not  assume  that  the  .Z file is correct simply
  42.      because the standard uncompress does not complain. This gen-
  43.      erally means that the standard uncompress does not check its
  44.      input, and happily generates garbage output.
  45.  
  46.      Files created by zip can be uncompressed  by  gzip  only  if
  47.      they  have  a  single member compressed with the 'deflation'
  48.      method. This feature is only intended to help conversion  of
  49.      tar.zip files to the tar.z format. To extract zip files with
  50.      several members, use unzip instead of gunzip.
  51.  
  52.      zcat is identical to gunzip -c. (On some systems,  zcat  may
  53.      be  installed  as  gzcat  to  preserve  the original link to
  54.      compress.) zcat uncompresses either a list of files  on  the
  55.      command   line   or   its  standard  input  and  writes  the
  56.      uncompressed data on standard output.  zcat will  uncompress
  57.      files that have the correct magic number whether they have a
  58.      .z suffix or not.
  59.  
  60.      Gzip uses the Lempel-Ziv algorithm used in  zip  and  PKZIP.
  61.      The  amount  of  compression obtained depends on the size of
  62.      the input and the distribution of common substrings.   Typi-
  63.      cally,  text  such  as  source code or English is reduced by
  64.      60-70%.  Compression is  generally  much  better  than  that
  65.      achieved  by  LZW  (as used in compress), Huffman coding (as
  66.      used in pack), or adaptive Huffman coding (compact).
  67.  
  68.      Compression is always performed, even if the compressed file
  69.      is  slightly larger than the original. The worst case expan-
  70.      sion is a few bytes for the gzip file header, plus  5  bytes
  71.      every  32K  block, or an expansion ratio of 0.015% for large
  72.      files.  gzip preserves the mode, ownership and timestamps of
  73.      files when compressing or decompressing.
  74.  
  75. OPTIONS
  76.      -c --stdout
  77.           Write output on standard output;  keep  original  files
  78.           unchanged.   If there are several input files, the out-
  79.           put consists of a sequence of independently  compressed
  80.           members.  To obtain better compression, concatenate all
  81.           input files before compressing them.
  82.  
  83.      -d --decompress
  84.           Decompress.
  85.  
  86.      -f --force
  87.           Force compression or decompression even if the file has
  88.           multiple   links  or  the  corresponding  file  already
  89.           exists.  If -f is not given, and when  not  running  in
  90.           the  background,  gzip  prompts  to  verify  whether an
  91.           existing file should be overwritten.
  92.  
  93.      -h --help
  94.           Display a help screen.
  95.  
  96.      -L --license
  97.           Display the gzip license.
  98.  
  99.      -q --quiet
  100.           Suppress all warnings.
  101.  
  102.      -r --recurse
  103.           Travel the directory structure recursively. If  any  of
  104.           the file names specified on the command line are direc-
  105.           tories,  gzip  will  descend  into  the  directory  and
  106.           compress  all  the  files it finds there (or decompress
  107.           them in the case of gunzip ).
  108.  
  109.      -t --test
  110.           Test. Check the compressed file integrity.
  111.  
  112.      -v --verbose
  113.           Verbose. Display the name and percentage reduction  for
  114.           each file compressed.
  115.  
  116.      -V --version
  117.           Version. Display the  version  number  and  compilation
  118.           options.
  119.  
  120.      -# --fast --best
  121.           Regulate the speed of compression using  the  specified
  122.           digit  #,  where  -1  or  --fast  indicates the fastest
  123.           compression method (less compression) and -9 or  --best
  124.           indicates   the  slowest  compression  method  (optimal
  125.           compression).  The default compression level is -5.
  126.  
  127. ADVANCED USAGE
  128.      Multiple compressed files can be concatenated. In this case,
  129.      gunzip will extract all members at once. For example:
  130.  
  131.            gzip -c file1  > foo.z
  132.            gzip -c file2 >> foo.z Then
  133.            gunzip -c foo
  134.  
  135.      is equivalent to
  136.  
  137.            cat file1 file2
  138.  
  139.      In case of damage to one member of a .z file, other  members
  140.      can  still  be recovered (if the damaged member is removed).
  141.      However, you can get better compression by  compressing  all
  142.      members at once:
  143.  
  144.            cat file1 file2 | gzip > foo.z
  145.  
  146.      compresses better than
  147.  
  148.            gzip -c file1 file2 > foo.z
  149.  
  150.      If you want to recompress concatenated files to  get  better
  151.      compression, do:
  152.  
  153.            zcat old.z | gzip > new.z
  154.  
  155. ENVIRONMENT
  156.      The environment variable GZIP can  hold  a  set  of  default
  157.      options  for  gzip.  These options are interpreted first and
  158.      can be overwritten by explicit command line parameters.  For
  159.      example:
  160.            for sh:    GZIP="-8 -v"; export GZIP
  161.            for csh:   setenv GZIP "-8 -v"
  162.            for MSDOS: set GZIP=-8 -v
  163.  
  164.      On  Vax/VMS,  the  name  of  the  environment  variable   is
  165.      GZIP_OPT,  to avoid a conflict with the symbol set for invo-
  166.      cation of the program.
  167.  
  168. SEE ALSO
  169.      znew(1), zcmp(1),  zmore(1),  zforce(1),  gzexe(1),  zip(1),
  170.      unzip(1), compress(1), pack(1), compact(1)
  171.  
  172. DIAGNOSTICS
  173.      Exit status is normally 0; if an error occurs,  exit  status
  174.      is 1. If a warning occurs, exit status is 2.
  175.  
  176.      Usage: gzip [-cdfhLrtvV19] [file ...]
  177.              Invalid options were specified on the command line.
  178.      file: not in gzip format
  179.              The  file  specified  to   gunzip   has   not   been
  180.              compressed.
  181.      file: Corrupt input. Use zcat to recover some data.
  182.              The compressed file has been damaged. The data up to
  183.              the point of failure can be recovered using
  184.                      zcat file > recover
  185.      file: compressed with xx bits, can only handle yy bits
  186.              File was compressed (using LZW) by  a  program  that
  187.              could  deal  with more bits than the decompress code
  188.              on this machine.  Recompress  the  file  with  gzip,
  189.              which compresses better and uses less memory.
  190.      file: already has z suffix -- no change
  191.              The  file  is  assumed  to  be  already  compressed.
  192.              Rename the file and try again or use zcat.
  193.      file already exists; do you wish to overwrite (y or n)?
  194.              Respond "y" if  you  want  the  output  file  to  be
  195.              replaced; "n" if not.
  196.      gunzip: corrupt input
  197.              A SIGSEGV violation was detected which usually means
  198.              that the input file has been corrupted.
  199.      xx.x%
  200.              Percentage  of  the  input  saved  by   compression.
  201.              (Relevant only for -v.)
  202.      -- not a regular file or directory: ignored
  203.              When the input file is not a regular file or  direc-
  204.              tory,  (e.g.  a  symbolic link, socket, FIFO, device
  205.              file), it is left unaltered.
  206.      -- has xx other links: unchanged
  207.              The input file has links; it is left unchanged.  See
  208.              ln(1) for more information. Use the -f flag to force
  209.              compression of multiply-linked files.
  210.  
  211. CAVEATS
  212.      The .z extension is already used by pack(1).  You  can  link
  213.      gzip  to  pcat to get transparent decompression for programs
  214.      expecting .z files to be in pack format.
  215.